<template>
	<layout>
    <el-table
      :data="tableData1"
      border style="width: 100%">
      <el-table-column
        prop="K1"
        label="星期一"
        width="180">
      </el-table-column>
      <el-table-column
        prop="K2"
        label="星期二"
        width="180">
      </el-table-column>
      <el-table-column
        prop="K3"
        label="星期三">
      </el-table-column>
      <el-table-column
        prop="K4"
        label="星期四">
      </el-table-column>
      <el-table-column
        prop="K5"
        label="星期五">
      </el-table-column>

    </el-table>
	
	</layout>

</template>

<script>
	import Layout from './new.vue'
  import axios from 'axios'
  import _ from 'lodash'
	export default {
 	components: {
 		Layout
 	},
 	data() {
      return {
        tableData1:[],

      }
    },
    mounted(){
    let vm = this;
    axios.get('api/hh/getKB',{
      params:{
        xn:2016,
        xq:1,
        dm:'0000356'
      }
    }).then(function(r){
      console.log(JSON.stringify(r));
      if(r.data.errorCode != '0'){
          vm.$message({
            message:'获取数据失败',
            type:'error',
          });
          return;
        }
        vm.data = r.data.obj;
        _(4).times(i=>{
          let obj = {};
          _(5).times(j=>{
            let k = 'K'+(j+1);
            let l = k + (i+1);
            console.log(l); 
            obj[k] = vm.data.filter(o=>o.jcz.startsWith(l)).map(o=>{
                return o.zwmc + ',' + o.bjmc;
              }).join('-----');
          });
          vm.tableData1.push(obj);
        });
    }).catch(e=>{
      console.log(e);
    });
  }
 } 
</script>
<style >
	.aadd{
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    background-color: #fff;
    border: 1px solid #dfe6ec;
    font-size: 14px;
    color: #1f2d3d
	},
	.aaaa{
	padding: 11px 19px;
	font-size: 16px;
	border-radius: 4px
	

	},
	.Two{
		width: 80%;
		padding: 11px 19px;
		font-size: 16px;
		border-radius: 4px

	},
	.button{

	padding: 11px 19px;
	font-size: 16px;
	border-radius: 4px

	},
	.uuu{
	padding: 11px 19px;
	font-size: 16px;
	border-radius: 4px

	}